$(function(){
		/*初始化表格*/
		$('#surroundExamine').datagrid({
    		url:'backsurroundexaminejson',
    		collapsible:true,
    		fit:true,
			fitColumns:true,
			toolbar:'#footer',
			pagination:true,
			pageSize:20,
			pageList:[20,50,100,200],
			remoteSort:false,
			onLoadSuccess:function(data){
		        if (data.total == 0) { 
				$(this).datagrid('appendRow', { cVoucher: '<div style="text-align:center;color:red">没有相关记录！</div>' }).datagrid('mergeCells', { index: 0, field: 'cVoucher', colspan: 4 }) 
				$(this).closest('div.datagrid-wrap').find('div.datagrid-pager').hide(); 
				 $(this).datagrid('hideColumn', 'ck');
				} 
				else {
					$(this).closest('div.datagrid-wrap').find('div.datagrid-pager').show();
					$(this).datagrid('showColumn', 'ck');}
		    },
   				columns:[[
   			 	{field:'ck',checkbox:true},
   			 	{field:'iID',hidden:'true'},
				{field:'cVoucher',title:'收据号',align:'center',width:'25%',
				 formatter:function(value,row,index){
					if(row.iID == undefined)return row.cVoucher;
					return'<a href="javascript:;">'+row.cVoucher+'</a>'
				}},
				{field:'fReceivable',title:'应收款',align:'center',width:'23%'},
				{field:'fReceipt',title:'实收款',align:'center',width:'25%'},
				{field:'iCashierState',title:'审核状态',align:'center',width:'25%',
					formatter:function(value,row,index){
						if(row.iCashierState == undefined)return '异常';
						if(row.iCashierState == 0)return '未审核';
						if(row.iCashierState == 1)return '通过';
						if(row.iCashierState == 2)return '未通过';
					}
				
				}
    		]]
		});
			
});

